Skip to content

Conversation

codenamenam
Copy link

@codenamenam codenamenam commented Aug 28, 2025

…y if default import is used with named import

This PR fixes an issue where verbatimModuleSyntax would leave empty curly braces {} in the JavaScript output when an import statement has a default import and all of its named imports are type-only.

The transformer logic is updated to check for the presence of a default binding on the import code.

Fixes #62239

…y if default import is used with named import
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Aug 28, 2025
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Aug 28, 2025
@jakebailey
Copy link
Member

This PR needs tests.

Copy link
Member

@RyanCavanaugh RyanCavanaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add some tests

@github-project-automation github-project-automation bot moved this from Not started to Waiting on author in PR Backlog Sep 25, 2025
@codenamenam
Copy link
Author

@jakebailey @RyanCavanaugh I added test case which verifies that empty braces are correctly removed from an import statement with a default binding and only type-only named bindings when verbatimModuleSyntax is enabled. If you have any questions, please let me know. Thank you!

@github-project-automation github-project-automation bot moved this from Waiting on author to Needs merge in PR Backlog Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Needs merge

Development

Successfully merging this pull request may close these issues.

verbatimModuleSyntax leaves empty curly brackets in the JS output

4 participants